<template>
	<view class="home">
		<!-- 轮播 -->
		<!-- {{infosss}} -->
		<view class="w750 mt20 mb20">
			<image style="width: 750rpx; height: 450rpx;" :src="'../../static/01.jpg'"></image>
		</view>
		<view v-if="userInfo.userName" class="w750 pd20">{{ '你好：'+userInfo.userName  }}</view>
		<view v-else class="d-center">
			<view class="w620 pd20 d-center  br50 mg30 bg_3274CB  ftc_fff" @click="gotoLogin">点击登录</view>
		</view>
		<!-- users -->
		<view v-if="userInfo.roleCode != 'admin' && userInfo.roleCode != ''" class="w720 mg15 d-warp">

			<view v-for="(item, index) in menuLists" :key="index" class="menu-view"
				@click="gotoPath(item.route)">
				<view class="menu-icon" >
					<image class="menu-img" :src="item.icon"></image>
				</view>
			
				<view class="menu-title">{{item.name}}</view>
			</view>
			
		</view>
		<!-- admin -->
		<view v-if="userInfo.roleCode == 'admin'" class="w720 mg15 d-warp">
			
			<view v-for="(item, index) in adminMenuLists" :key="index" class="menu-view"
				@click="gotoPath(item.route)">
				<view class="menu-icon" >
					<image class="menu-img" :src="item.icon"></image>
				</view>
							
				<view class="menu-title">{{item.name}}</view>
			</view>
		</view>
		
		<!-- 测试切换用户 -->
		<view class="d-bt w720 mg15 d-warp pos_bottom">
			<view class="w350 h200 " @click="changeUser(0)"></view>
			<view class="w350 h200 " @click="changeUser(1)"></view>
		</view>
	</view>
</template>
<script>
	import mixin from "./mixin";
	import mixinCom from "@/utils/mixinCom.js";
	export default {
		name: "tabbarIndex",
		mixins: [mixin, mixinCom]
	}
</script>

<style lang="scss" scoped>
	@import './index.scss';
</style>